# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Forms.V1.Model.Grading do
  @moduledoc """
  Grading for a single question

  ## Attributes

  *   `correctAnswers` (*type:* `GoogleApi.Forms.V1.Model.CorrectAnswers.t`, *default:* `nil`) - Required. The answer key for the question. Responses are automatically graded based on this field.
  *   `generalFeedback` (*type:* `GoogleApi.Forms.V1.Model.Feedback.t`, *default:* `nil`) - The feedback displayed for all answers. This is commonly used for short answer questions when a quiz owner wants to quickly give respondents some sense of whether they answered the question correctly before they've had a chance to officially grade the response. General feedback cannot be set for automatically graded multiple choice questions.
  *   `pointValue` (*type:* `integer()`, *default:* `nil`) - Required. The maximum number of points a respondent can automatically get for a correct answer. This must not be negative.
  *   `whenRight` (*type:* `GoogleApi.Forms.V1.Model.Feedback.t`, *default:* `nil`) - The feedback displayed for correct responses. This feedback can only be set for multiple choice questions that have correct answers provided.
  *   `whenWrong` (*type:* `GoogleApi.Forms.V1.Model.Feedback.t`, *default:* `nil`) - The feedback displayed for incorrect responses. This feedback can only be set for multiple choice questions that have correct answers provided.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :correctAnswers => GoogleApi.Forms.V1.Model.CorrectAnswers.t() | nil,
          :generalFeedback => GoogleApi.Forms.V1.Model.Feedback.t() | nil,
          :pointValue => integer() | nil,
          :whenRight => GoogleApi.Forms.V1.Model.Feedback.t() | nil,
          :whenWrong => GoogleApi.Forms.V1.Model.Feedback.t() | nil
        }

  field(:correctAnswers, as: GoogleApi.Forms.V1.Model.CorrectAnswers)
  field(:generalFeedback, as: GoogleApi.Forms.V1.Model.Feedback)
  field(:pointValue)
  field(:whenRight, as: GoogleApi.Forms.V1.Model.Feedback)
  field(:whenWrong, as: GoogleApi.Forms.V1.Model.Feedback)
end

defimpl Poison.Decoder, for: GoogleApi.Forms.V1.Model.Grading do
  def decode(value, options) do
    GoogleApi.Forms.V1.Model.Grading.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Forms.V1.Model.Grading do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
